package com.hmys.api.service.impl;

import com.hmys.api.mapper.WebADMapper;
import com.hmys.api.mapper.WebADPhotoMapper;
import com.hmys.api.model.WebAD;
import com.hmys.api.model.WebADPhoto;
import com.hmys.api.service.WebADService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chen365 on 2018/03/16.
 */
@Service
public class WebADServiceImpl implements WebADService {
    @Autowired
    private WebADPhotoMapper webADPhotoMapper;

    @Autowired
    private WebADMapper webADMapper;

    @Override
    public List<WebADPhoto> selectAllByAdId(Long adId) {
        WebADPhoto record = new WebADPhoto();
        record.setAdId(adId);
        record.setStatus(true);
        return webADPhotoMapper.selectAllByBean(record);
    }

    @Override
    public WebAD selectADByPrimaryKey(Long id) {
        return webADMapper.selectByPrimaryKey(id);
    }
}
